<h1>Load <%= @repository.name %></h1>
<h3 class="color_red">Please wait. Page will redirect when completed.</h3>
<div id="load_log">
	Loading...
</div>

<script>
OnEvent.add(window, "load", function() {

	var pe = new PeriodicalExecuter(function() {

		new zAjax().send({
			url: FULL_URL + "/repositories/" + ExtractIdFromUrl("repository") + "/wait_load",
			sync: true,
			method: "GET",
			success: function(xhr) {
				var msg = xhr.responseText;
				if(/^load_complete$/.test(msg)) {
					location.replace("/repositories");
				}
				else document.getElementById("load_log").innerHTML = msg;
			},
			failure: function(xhr) {
				// fail;
			}
		})

	}, 1);
});
</script>
